import sublime, sublime_plugin
import webbrowser
class OpenBrowserCommand(sublime_plugin.TextCommand):
    def run(self,edit):
        window = sublime.active_window()
        window.run_command('save')
        url = self.view.file_name()
        url = url.replace('\\', '/')
        # replace with your own paths
        url = url.replace('E:/CODE/iis', 'http://localhost/')
        print(url)
        webbrowser.open(url)



#按键设置
#[
#{"keys": ["f5"],"command": "open_browser"}
#]
